const Router = require('koa-router')
const Setting = require('../models/Setting')
const router = new Router()
router.prefix('/setting')
router.get('/', async (ctx, next) => {
  // 获取系统配置
  const res = await Setting.findOne()
  ctx.body = {
    code: 200,
    data: {
      ...res.dataValues,
      keyWord: JSON.parse(res.keyWord)
    },
  }
})
router.post('/backup', async (ctx, next) => {
  // 备份数据库文件
})

module.exports = router
